Hybim 634 vertexai tool calls#275
Open
shuwpan wants to merge 9 commits intosignalfx:mainfrom
Open
Conversation
1b54353 to
1d3984d
Compare
008479a to
807a83a
Compare
adityamehra
approved these changes
May 5, 2026
…nvocation - Migrate from raw spans to TelemetryHandler lifecycle (start_llm/stop_llm/fail_llm) - Build LLMInvocation with text and tool-response message parts - Remove _StabilityMode branching, events.py, and completion_hook paths - Remove experimental test files (merged into main test suite)
…lResponse - Map function_call parts to ToolCall, function_response to ToolCallResponse - Populate request_functions from tool definitions (always, independent of content capture) - Add tests for function call spans, tool events, and request function attributes
…itions with env var - Use invocation.tool_definitions instead of invocation.attributes[GEN_AI_TOOL_DEFINITIONS] - Gate tool_definitions with should_capture_tool_definitions() (OTEL_INSTRUMENTATION_GENAI_CAPTURE_TOOL_DEFINITIONS) - Use invocation.output_type instead of invocation.attributes[GEN_AI_OUTPUT_TYPE] - Set request_choice_count and request_top_k on LLMInvocation - Extract top_k from Vertex AI GenerationConfig - Add tests for tool_definitions opt-in behavior
- P2: Move duplicate assert_handler_event helper to shared_test_utils.py - P3: Add test for _map_finish_reason(None) null safety path - P3: Replace silent pass with logging.exception in defensive catch blocks
…for initial release
807a83a to
1714180
Compare
CI installs pytest-recording (from langchain test deps) which conflicts with the module-scoped vcr fixture from pytest-vcr. Adapt conftest.py: - Add pytest-recording/pytest-vcr detection (matching langchain pattern) - Create VCR instance directly in generate_content fixture - Simplify vertexai_init to always use anonymous credentials in tests Signed-off-by: shuwpan <shuwpan@cisco.com>
adityamehra
requested changes
May 6, 2026
Contributor
There was a problem hiding this comment.
@shuwpan please also add an examples where vertex ai LLM call uses a tool call
| ) | ||
|
|
||
| if capture_content and params.tools: | ||
| if capture_content and params.tools and should_capture_tool_definitions(): |
Contributor
There was a problem hiding this comment.
Please see the latest usage regarding capture_content from main. We have removed it from the instrumentation layer as per this
| except Exception: | ||
| pass | ||
| logging.exception("Failed to record LLM error") | ||
| raise |
Contributor
There was a problem hiding this comment.
I don't think we should be raising exceptions from the instrumentation layer. Logging should be fine. Please see openai_v2 for reference
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #271 (HYBIM-623_replace_current_impl_with_LLMInvocation)
https://shw-playground.signalfx.com/#/apm/traces/288c2aa13aa53d9fb23e838e0c27db63
https://shw-playground.signalfx.com/#/apm/traces/d35e404fbf45b4624e356d908a7a9195